#include <iostream>
#include <cmath>
using namespace std;

//（1）开始时的总桃子数：X = 5^n - 4
//（2）老猴子最后能得到的桃子数：n + (X+4)*(4/5)^n - 4 = n + 4^n - 4
int main()
{
    int n;  // 小猴子个数
    while(cin >> n){
        if(n == 0)
            return 0;
        int peachs = 0, oldnum = 0;
        peachs = pow(5, n)-4;
        oldnum = n+pow(4, n)-4;
        cout << peachs <<' '<< oldnum << endl;
    }
    return 0;
}